<template>
	<view class="page">
		<!-- 头部 -->
		<view class="frist">
			<view class="left">
				<view class="usernameid">
					<view class="username">
						{{username}}
					</view>
					<view class="idnum">
						{{idnum}}
					</view>
				</view>
				<view class="integral">
					积分余额：<text>{{integral}}</text>
				</view>
			</view>
			<image :src="img" mode="" class="photobox"></image>
		</view>

		<!-- 业绩部分 -->
		<view class="yellowbox">
			<view class="box">
				<view class="num">
					<text>{{achievement}}</text>
				</view>
				<view class="prif">
					本月业绩
				</view>
			</view>
			<view class="box">
				<view class="num nums">
					<text>{{look}}次</text>
				</view>
				<view class="prif">
					本月带看
				</view>
			</view>
			<view class="box">
				<view class="num numss">
					<text>{{deal}}单</text>
				</view>
				<view class="prif">
					本月成交数
				</view>
			</view>
		</view>


		<!-- 最后一部分 -->
		<view class="last" v-for="(item,index) in arr" :key="index" @click="last(item)"
			v-if="!item.flag || (item.flag == 1 && flag  == 1)">
			<view class="left">
				<image :src="item.img" mode="" class="icon"></image>
				<view class="text">
					{{item.text}}
				</view>
			</view>
			<image src="https://fangguaner.wm76.mtnet.ren/static/applet/right.png" mode="" class="right"></image>
		</view>

		<!-- <BaseBottom :selectPath="'/pages/me/index'"></BaseBottom> -->
	</view>
</template>

<script>
	// import BaseBottom from '../../components/BaseBottom/index.vue'
	import {
		getme
	} from "../../api/api/index.js"
	export default {
		data() {
			return {
				username: "",
				idnum: "",
				integral: "",
				img: "",
				achievement: 0,
				look: 0,
				deal: 0,
				arr: [{
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/verify.png",
					text: "房源信息",
				}, {
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/tu3.png",
					text: "客源信息"
				}, {
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/tu4.png",
					text: "文档中心"
				}, {
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/tu2.png",
					text: "带看记录"
				}, {
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/tu.png",
					text: "积分兑换记录"
				}, {
					img: "http://fangguaner.oss-cn-chengdu.aliyuncs.com/upload/20210709/ed27bed8abe00b2688ec0de05bb56fa6.png",
					text: "交易记录列表"
				}, {
					img: "https://fangguaner.wm76.mtnet.ren/static/applet/li8.png",
					text: "考试记录"
				}, {
					img: "http://fangguaner.oss-cn-chengdu.aliyuncs.com/upload/20210629/8465a74d459aa6f191a2600f0743695a.png",
					text: "审核房源",
					flag: 1
				}, {
					img: "http://fangguaner.oss-cn-chengdu.aliyuncs.com/upload/20210707/d48e6da05ffb01c63f627c4e3e91d732.png",
					text: "审核成交",
					flag: 1
				}, {
					img: "http://fangguaner.oss-cn-chengdu.aliyuncs.com/upload/20210707/7769988c9ff0eaee70ff0f31e1656725.png",
					text: "修改密码"
				}],
				
				
				flag: 0
			}
		},
		methods: {
			last: function(item) {
				if (item.text == "带看记录") {
					this.jumpLink({link:"/pages/takelookat/index"})
				} else if (item.text == "房源信息") {
					this.jumpLink({link:"/pages/housingresource/index"})
				} else if (item.text == "客源信息") {
					this.jumpLink({link:"/pages/passengersource/index"})
				} else if (item.text === "考试记录") {
					this.jumpLink({link:"/pages/Testrecords/index"})

				} else if (item.text == "文档中心") {
					this.jumpLink({link:"/pages/Documentcenter/index"})
				} else if (item.text == "审核房源") {
					this.jumpLink({link:"/pages/date_of_approval/index"})
				} else if (item.text == "修改密码") {
					this.jumpLink({link:"/pages/resetpasswords/index"})
				}else if (item.text == "审核成交") {
					this.jumpLink({link:"/pages/check/index"})
				}else if (item.text == "交易记录列表") {
					this.jumpLink({link:"/pages/sucessrecord/index"})
				}else if (item.text == "积分兑换记录") {
					this.jumpLink({link:"/pages/Pointsexchangerecord/index"})
				}
				
			},
		},
		components: {
		},
		onLoad() {
			getme().then(res => {
				this.flag = res.data.is_examine
				let item = res.data
				this.username = item.name
				this.idnum = item.phone
				this.img = item.header_img
				this.integral = item.integral
				this.achievement = item.achievement
				this.look = item.look
				this.deal = item.deal
			})
		},
		onShow() {
			uni.hideHomeButton();
		}
	}
</script>

<style>
	.frist {
		display: flex;
		justify-content: space-between;
		padding-left: 47rpx;
		padding-right: 20rpx;
		box-sizing: border-box;
		margin-top: 50rpx;
	}

	.frist>.left {}

	.usernameid {
		display: flex;
		justify-content: space-between;
	}

	.username {
		font-size: 48rpx;
		color: #000000;
		font-family: MicrosoftYaHei;
	}

	.idnum {
		font-size: 24rpx;
		font-family: PingFang-SC-Medium;
		color: #828282;
		margin-top: 27rpx;
		margin-left: 36rpx;
	}

	.photobox {
		width: 120rpx;
		height: 120rpx;
		border-radius: 120rpx;
	}

	.integral {
		margin-top: 25rpx;
		font-size: 24rpx;
		color: #828282;
	}

	.integral>text {
		color: #fe1f1f;
	}


	/*黄色导航 */
	.yellowbox {
		width: 680rpx;
		height: 173rpx;
		background-color: #ffcf11;
		border-radius: 10rpx;
		display: flex;
		justify-content: space-between;
		margin-left: 36rpx;
		margin-top: 36rpx;
		padding: 51rpx 53rpx 30rpx 53rpx;
		box-sizing: border-box;
		margin-bottom: 60rpx;
	}

	.num {
		font-size: 24rpx;
		color: #000000;
		font-family: PingFang-SC-Heavy;
		font-weight: 700;
		margin-bottom: 20rpx;
		text-align: center;
	}

	.nums {}

	.numss {
		margin-left: 20rpx;
	}

	.num>text {
		font-size: 36rpx;
		margin-right: 10rpx;
	}

	.prif {
		font-size: 24rpx;
		color: #000000;
		font-family: MicrosoftYaHei;
		margin-left: 8rpx;
	}

	/* 最后一部分 */
	.last {
		display: flex;
		justify-content: space-between;
		padding-left: 44rpx;
		padding-right: 56rpx;
		box-sizing: border-box;
		margin-bottom: 59rpx;
	}

	.last>.left {
		display: flex;
		justify-content: space-around;
	}

	.icon {
		width: 43rpx;
		height: 38rpx;
	}

	.icon:nth-child(1) {
		width: 35rpx;
		height: 42rpx;
	}

	.icon:nth-child(2) {
		width: 38rpx;
		height: 38rpx;
	}

	.icon:nth-child(3) {
		width: 37rpx;
		height: 39rpx;
	}

	.icon:nth-child(4) {
		width: 41rpx;
		height: 41rpx;
	}

	.icon:nth-child(5) {
		width: 36rpx;
		height: 40rpx;
	}

	.last .text {
		font-family: PingFang-SC-Medium;
		font-size: 30rpx;
		color: #282828;
		margin-left: 17rpx;
	}

	.last .right {
		width: 17rpx;
		height: 30rpx;
		margin-top: 10rpx;
	}


	/* 退出登入 */
	.login {
		width: 600rpx;
		height: 103rpx;
		background-image: linear-gradient(-30deg,
				#e1312d 0%,
				#f8524f 99%),
			linear-gradient(#ffffff,
				#ffffff);
		/* background-color: #ffcf11; */
		background-blend-mode: normal, normal;
		box-shadow: 0rpx 6rpx 13rpx 2rpx;
		border-radius: 52rpx;
		text-align: center;
		line-height: 103rpx;
		font-size: 36rpx;
		font-family: MicrosoftYaHei;
		font-weight: 700;
		color: #FFFFFF;
		margin-left: 76rpx;
	}
</style>
